import org.springframework.jms.core.support.JmsGatewaySupport;
import org.springframework.transaction.annotation.Transactional;
import org.apache.activemq.broker.BrokerService;
import org.apache.activemq.ActiveMQConnectionFactory;
import org.springframework.jms.core.JmsTemplate;

import javax.jms.*;


public class FrontDeskImpl extends JmsGatewaySupport implements FrontDesk {
	
	public FrontDeskImpl()
	{		
	}	
	
	@Override
	@Transactional 
	public void sendMail(Mail mail) {
		
		//setupMessageQueueConsumer();
		
		System.out.println("Sending mail now ...");
		JmsTemplate template = getJmsTemplate();
		
		template.convertAndSend(mail);		
				
		System.out.println("Mail sent.");		
	}	

}
